package com.prb.tomcat.handler;

import com.prb.tomcat.protocol.IServlet;
import com.prb.tomcat.protocol.RequestHolder;


public class DefaultServletHandler implements ServletHandler {


    public Object handler(RequestHolder requestHolder , IServlet servlet) {

        Object returnVal = null;

        switch (requestHolder.getMethod()){
            case "GET":
                System.out.println("get method");
                returnVal = servlet.doGet(null , null);
                break ;

            case "POST":
                System.out.println("post method");
                returnVal = servlet.dopOST(null , null);
                break;
            default:
                System.out.println("default method");
                break;
        }

        return returnVal;
    }
}
